package cn.tedu.rabbitmqspringboot.m1;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@Component
public class Consumer {
    /*
    消费者自动注册，自动连接服务器，自动开启消息监听
     */
    @RabbitListener(queues = "helloworld")
    public void receive(String msg) {
        System.out.println("收到： "+msg);
    }
}
